<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<!--    <link rel="stylesheet" href="css/todo.css?v=0.2">-->
<!--    <script src="./js/todo.js"></script>-->
    <title>核酸检测统计平台-学生端</title>
    <style>
        li{
            color:#F00;
        }
        .a1{
            border-style: solid;
            padding-top: 20px;
            padding-left: 10px;
            margin-bottom: 20px;
        }
    </style>
    <script>
        function radio_click(){
            console.log("123");
            var hesuan = document.getElementsByName("hesuan");
            for(i=0;i<hesuan.length;i++){
                if(hesuan[i].checked){
                    console.log(hesuan[i].value);
                    hesuan_value = hesuan[i].value;
                }
            }
            if(hesuan_value=="是"){
                document.getElementById("yiwancheng").style.display="";
                document.getElementById("weiwancheng").style.display="none";
            }else{
                document.getElementById("yiwancheng").style.display="none";
                document.getElementById("weiwancheng").style.display="";
            }

        }
        function add()
        {
            var todo_value = document.getElementById("todo").value;

            var hesuan = document.getElementsByName("hesuan");
            for(i=0;i<hesuan.length;i++){
                if(hesuan[i].checked){
                    console.log(hesuan[i].value);
                    hesuan_value = hesuan[i].value;
                }
            }
            if(hesuan_value=="是"){
                var place = document.getElementsByName("place");
                for(i=0;i<place.length;i++){
                    if(place[i].checked){
                        console.log(place[i].value);
                        place_value = place[i].value;
                    }
                }

            }else{
                var situation = document.getElementsByName("situation");
                for(i=0;i<situation.length;i++){
                    if(situation[i].checked){
                        console.log(situation[i].value);
                        situation_value = situation[i].value;
                    }
                }

            }


            var todo_list = document.getElementById("todo_list");
            console.log(todo_list);

            var ele = document.createElement("li");
            var result =todo_value;
            if(place!=null) result+="已做核酸，地点是"+place_value;
            if(situation!=null) result+="未做核酸，"+situation_value;
            ele.innerHTML = result;
            // alert(result);
            todo_list.appendChild(ele);
        }

    </script>
</head>
<body>
    <div style="margin-bottom: 20px;">{$msg}</div>
    
<form method="post" action="save">
    <input type="hidden" name="type" value={$id}>
    <div class="a1" >
        本人本周是否完成核酸检测
        <div>
            <input type="radio" onclick="radio_click()" name="hesuan" value="是" checked>是
            <input type="radio" onclick="radio_click()" name="hesuan" value="否" >否
        </div>

    </div>

    <div class="a1" id="yiwancheng">
        <div>如已完成，请选择核酸检测地点</div>
        <div id="place">
            <input type="radio" name="place" value="大兴" checked>大兴
            <input type="radio" name="place" value="燕园" >燕园
            <input type="radio" name="place" value="校外" >校外
        </div>
    </div>
    <div class="a1" id="weiwancheng" style="display: none">
        <div>如未完成，请选择情况</div>
        <div id="situation">
            <input type="radio" name="situation" value="本人承诺在24小时内补做核酸" checked>本人承诺在24小时内补做核酸
            <br>
            <input type="radio" name="situation" value="本人不属应检尽检情况" >本人不属应检尽检情况
            <br>
            <input type="radio" name="situation" value="其他特殊情况，本人承诺向学工老师说明情况" >其他特殊情况，本人承诺向学工老师说明情况
        </div>
    </div>
    <div>
        <input type="submit" value="提交">
    </div>
</form>



</body>


</html>